package com.lrs.java.j2se_self.gui;
import java.awt.*;
import java.awt.event.*;

public class TestActionEvent {
	public static void main(String[] args){
		Frame f = new Frame("my frame");
		f.setBounds(100,150,300,500);
		Button b = new Button("OK");
		Monitor m = new Monitor();
		b.addActionListener(m);
		f.add(b);
		f.pack();
		f.setVisible(true);
	}
}

class Monitor implements ActionListener{
	public void actionPerformed(ActionEvent e){
		System.out.println("a button pressed!");
	}
}